@use "sass:math";

@import '../../../stylesheets/colors';
@import '../../../stylesheets/variables';

.result-page__search-input {
  width: 100%;
}

.flash-message {
  @include font-size-sm;
  padding: math.div($global-spacing, 3) $global-spacing * 2;
  text-align: center;
  color: darken($pastel-green, 20%);
  align-self: center;
  margin-top: $global-spacing;
  position: relative;
  display: flex;
  align-items: center;

  code {
    color: darken($pastel-green, 25%);
    font-size: 95%;
  }

  a {
    text-decoration: underline;
    color: inherit;
  }
}

.flash-message__icon {
  margin-left: $global-spacing * 0.5;
  margin-right: $global-spacing;
  height: $global-spacing * 2.5;
  width: auto;
}

.result-error {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  flex-grow: 1;
}

.result-error__details {
  font-family: $font-family-code;
  text-transform: none;

  summary {
    text-align: center;
    color: lighten($raven, 10%);

    &:focus {
      outline: none;
    }
  }

  pre {
    max-width: 600px;
    @include font-size-sm;
    font-weight: $font-weight-light;
    text-align: left;
    color: $raven;
    line-height: 1.5;
    background: transparentize($raven, 0.94);
    padding: $global-spacing $global-spacing * 2;
    white-space: normal;
    border-radius: 10px;
  }
}

.result-error__img {
  width: 195px * 0.8;
  height: 181px * 0.8;
  opacity: 0.2;
}

.result-error__code {
  font-family: $font-family-code;
  margin-top: $global-spacing * 3;
  margin-bottom: 0;
}

.result-error__message {
  margin-top: $global-spacing;
  font-weight: $font-weight-light;
  color: $raven;
  max-width: $global-spacing * 60;
  text-align: center;
  line-height: 1.5;
}

.page-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 6px);
}

.content-container {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 4vh 0;

  &:first-of-type {
    margin-top: 0;
  }
}

.content-split-container {
  display: flex;
  justify-content: space-around;
  width: 100%;
  margin-top: 10vh;

  @media screen and (max-width: 48em) {
    flex-direction: column;
    margin-top: 5vh;
  }

  @media screen and (max-width: 40em) {
    padding: 0 $global-spacing * 2;
  }
}

.content-container-wrap {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0 10%;
  flex-grow: 1;
  animation: fade-in-full 0.2s;
}

.result-pending,
.result-error {
  min-height: 75vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-container {
  width: 400px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1 1 0;

  @media screen and (max-width: 48em) {
    margin: 5vh 0;
    align-items: center;
    flex: 1;
    width: 100%;
  }
}

.stats-container {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  margin: auto 0;
  flex: 1 1 0;

  @media screen and (max-width: 48em) {
    flex: 1;
  }
}

.time-container {
  border-top: 1px solid lighten($raven, 50%);
  padding-top: 5vh;

  @media screen and (max-width: 48em) {
    padding-top: 3vh;
  }
}

.size-container {
  margin-bottom: 5vh;

  @media screen and (max-width: 48em) {
    margin-bottom: 3vh;
  }
}

.size-container,
.time-container {
  display: flex;
  align-items: center;
  flex-direction: column;
}

.size-container h3,
.time-container h3 {
  @include font-size-md;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: $font-weight-thin;
  margin: 0 0 $global-spacing * 2;
  color: lighten($raven, 10%);

  @media screen and (max-width: 48em) {
    margin: 0 0 $global-spacing;
  }
}

.size-stats,
.time-stats {
  display: flex;
}

.ct-series-a .ct-bar {
  stroke: #00b4ae;
  stroke-width: 40px;
}

@keyframes fade-in-full {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.result__section-heading {
  @include font-size-md-2;
  text-align: center;
  position: relative;
  margin-top: 0;
}

.result__section-heading--new {
  &::after {
    @include font-size-xs;
    content: 'NEW';
    font-family: $font-family-code;
    padding: $global-spacing * 0.2 math.div($global-spacing, 1.5);
    position: absolute;
    top: 0;
    margin-left: $global-spacing;
    background: #ffbc40;
    border-radius: 2px;
    line-height: 1.2;
  }
}

// Treemap section

.treemap__section {
  width: 100%;
}

.treemap {
  @include font-size-sm;
  color: rgba(0, 0, 0, 0.6);
}

.treemap__square {
  transition: all 0.3s;
  position: relative;

  &:hover {
    //transform:scale(1.05);
    z-index: 1;
    color: rgba(0, 0, 0, 0.8);
    //box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.12);
    filter: brightness(105%);
  }
}

.treemap__content {
  max-height: 100%;
  max-width: 100%;
}
.treemap__label {
  font-family: $font-family-code;
  max-height: 75%;
  max-width: 100%;
  overflow: hidden;
  a {
    color: inherit;

    &:hover {
      text-decoration: underline;

      &::after {
        position: absolute;
        content: '↗';
      }
    }
  }
}

.treemap__percent {
  @include font-size-xl;
  display: block;
  font-weight: $font-weight-bold;
  letter-spacing: -1px;
  color: rgba(0, 0, 0, 0.5);

  .treemap__square:hover & {
    color: rgba(0, 0, 0, 0.8);
  }

  //color: black;
  mix-blend-mode: soft-light;

  // Disabling this for mobiles and tablets
  // since text seems to glitch due to it
  @media screen and (max-width: 48em) {
    mix-blend-mode: normal;
  }
}

.treemap__percent-sign {
  font-size: 50%;
  padding-left: 2px;
}

.treemap__ellipsis {
  color: rgba(0, 0, 0, 0.35);
}

.treemap__note {
  @include font-size-xs;
  color: $raven;
  margin: $global-spacing * 3 0 0 0;
  line-height: 1.2;
}
